//
//  ESTrainCodeNetResult.m
//  EasyStyle
//
//  Created by FK on 15/12/17.
//  Copyright © 2015年 FK. All rights reserved.
//

#import "ESTrainCodeNetResult.h"
@implementation ESTrainCodeNetResult

// 解析业务数据
- (void)parseNetResult:(NSDictionary *)jsonDictionary
{
    _listItem = [ESTrainListInfo new];
    _listItem.price_list = [NSMutableArray array];
    
    
    [super parseNetResult:jsonDictionary];
    
    if ([self.result isKindOfClass:[NSDictionary class]]) {
        _title = self.result[@"title"];
        
        NSDictionary *list = self.result[@"list"];
        _listItem.train_no = list[@"train_no"];
        _listItem.train_type = list[@"train_type"];
        _listItem.start_station = list[@"start_station"];
        _listItem.start_station_type = list[@"start_station_type"];
        _listItem.end_station = list[@"end_station"];
        _listItem.end_station_type = list[@"end_station_type"];
        _listItem.start_time = list[@"start_time"];
        _listItem.end_time = list[@"end_time"];
        _listItem.run_time = list[@"run_time"];
        _listItem.run_distance = list[@"run_distance"];
        
        NSDictionary *priceList = list[@"price_list"];
        
        NSArray *item = priceList[@"item"];
        for (NSDictionary *dict in item) {
            PriceList *listItem = [PriceList new];
            listItem.price_type = dict[@"price_type"];
            listItem.price = dict[@"price"];
            [_listItem.price_list addObject:listItem];
        }
    }

}

@end

